<div class='top' onmousedown='sortable()' title='可以用鼠标拖拽来随意摆放哦'>
  <div class='title'>
    <%= link_to_tool_by_setting @setting %>
  </div>
  <div class='supports'>
    <%= link_to_remote image_tag(
           'base/funcs/sms.png', 
           :alt => '发送到我的手机', 
           :title => '发送到我的手机'
         ),
         :url => send_sm_tools_weather_forecasts_url(:id => @setting.id) ,
         :method => :post,
         :loading => "$('sms_#{@setting.id}').innerHTML = '...'",
         :success => "alert('已经成功发送到您的手机上')",
         :failure => "alert(fetion_sm_state_name(request.responseText));", 
         :complete => "$('sms_#{@setting.id}').innerHTML = '#{image_tag(
           'base/funcs/sms.png', 
           :alt => '发送到我的手机', 
           :title => '发送到我的手机'
         )}'",
         :html => {
           :id => "sms_#{@setting.id}"
         } if @setting.allow_sms? 
    %>
    <%= link_to_remote image_tag(
           'base/funcs/email.png', 
           :alt => '发送到我的邮箱', 
           :title => '发送到我的邮箱'
         ),
         :url => send_email_tools_weather_forecasts_url(:id => @setting.id) ,
         :method => :post,
         :loading => "$('email_#{@setting.id}').innerHTML = '...'",
         :success => "alert('已经成功发送到您的邮箱里')",
         :complete => "$('email_#{@setting.id}').innerHTML = '#{image_tag(
           'base/funcs/email.png', 
           :alt => '发送到我的邮箱', 
           :title => '发送到我的邮箱'
         )}'",
         :html => {
           :id => "email_#{@setting.id}"
         } if @setting.allow_email? 
    %>
  </div>
  <div class='tools'>
    <span id="portalet_<%= @setting.id %>_arrows" style='display:none;'>
      <%= link_to "←", "index", :class => :arrow %>
      <%= link_to "↑", "index", :class => :arrow %>
      <%= link_to "↓", "index", :class => :arrow %>
      <%= link_to "→", "index", :class => :arrow %>
    </span>
    <span class='h'>
      <%= link_to_remote "克隆", 
            :update => "' + $('portalet_#{@setting.id}').parentNode.id + '" ,
            :url => copy_tools_weather_forecast_url(@setting),
            :method => :post,
            :html => {
              :class => :h 
            }            
        %>
      <%= link_to_remote "设置", 
            :update => "portalet_#{@setting.id}" ,
            :url => edit_tools_weather_forecast_url(@setting),
            :method => :get,
            :html => {
              :class => :h 
            }            
        %>
      <%= link_to_remote "移除", 
            :confirm => '确认要扔掉这片吐司吗？',
            :url => tools_weather_forecast_url(@setting),
            :method => :delete,
            :loading => "Effect.Fade('portalet_#{@setting.id}')",
            :html => {
              :class => :h 
            }            
        %>
    </span>
  </div>
</div>
<div id='tool_<%= @setting.id %>_content' class='content'>
  <div class='weather_forecast'>
    <div class="left">
      <h3><em><%= @weather_info['city'] %></em></h3>
      <h4>
        <%= image_tag "http://m.weather.com.cn/img/b#{@weather_info['img1']}.gif", 
              :alt => @weather_info['img_title1'],
              :title => @weather_info['img_title1'] %>
      </h4>
      <h4><em><%= @weather_info['weather1'] %></em></h4>
    </div>
    <div class="right">
      <h4>温　度：<em><%= @weather_info['temp1'] %></em></h4>
      <h4>风　力：<em><%= @weather_info['wind1'] %></em></h4>
      <h4>湿　度：<em><%= @today_weather_info['SD'] %></em></h4>
      <h4>紫外线：<em><%= @weather_info['index_uv'] %></em></h4>
      <h4>发　布：<em>今日 <%= @weather_info['fchh'] %>时</em></h4>
      <h4 class="more"><a id="url8" href="http://www.weather.com.cn/html/weather/<%= @area.weather_com_cn_code %>.shtml" target="_blank">未来七天预报</a></h4>
    </div>
    <div class='bottom'>
      <div class='day'>
        <div class='head'>
          明天
        </div>
        <div class='temp'>
          <%= @weather_info['temp2'] %>
        </div>
        <div class='weather'>
          <%= image_tag "http://m.weather.com.cn/a_30x30/a#{@weather_info['img3']}.png", 
              :alt => @weather_info['img_title3'],
              :title => @weather_info['img_title3'] %>
        </div>
      </div>
      <div class='day'>
        <div class='head'>
          后天
        </div>
        <div class='temp'>
          <%= @weather_info['temp3'] %>
        </div>
        <div class='weather'>
          <%= image_tag "http://m.weather.com.cn/a_30x30/a#{@weather_info['img5']}.png", 
              :alt => @weather_info['img_title5'],
              :title => @weather_info['img_title5'] %>
        </div>
      </div>
      <div class='day last'>
        <div class='head'>
          大后天
        </div>
        <div class='temp'>
          <%= @weather_info['temp4'] %>
        </div>
        <div class='weather'>
          <%= image_tag "http://m.weather.com.cn/a_30x30/a#{@weather_info['img7']}.png", 
              :alt => @weather_info['img_title7'],
              :title => @weather_info['img_title7'] %>
        </div>
      </div>
    </div>  
    <% if @alerts.any? %>
    <div class='weather_alerts'>
      <% @alerts.each do |alert| %>
      <div class='alert'>
        <%= link_to alert.title, alert.url, :target => :_blank, :title => alert.content %>
      </div>
      <% end %>
    </div>
    <% end %>
  </div>  
</div>

  